package base.day12;

import java.util.Scanner;

public class CharCompare {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入：");
        String s = sc.nextLine();
        int max = 0;
        int min = 0;
        int number = 0;
        char[] charArray = s.toCharArray();
        for (int i = 0; i < s.length(); i++) {
            if (charArray[i] >= 'A' && charArray[i] <= 'Z') {
                max += 1;
            }
            if (charArray[i] >= 'a' && charArray[i] <= 'z') {
                min += 1;
            } else if (charArray[i] >= '0' && charArray[i] <= '9') {
                number += 1;
            }
        }
        System.out.println("大写字母有" + max + "个");
        System.out.println("小写字母有" + min + "个");
        System.out.println("数字有" + number + "个");
    }
}
